package edu.spec.dengyan.week09.class02.homework;

import java.util.ArrayList;
import java.util.List;

/**
 * Author       : Dengyan
 * Date         : 2018/10/11 23:19
 * Description  : “Animal”类
 */
public class Animal {
    //成员属性1，动物的名字，name，String类型，访问类型为private
    //成员属性2，动物的叫声，sounds，类型为List，sounds用来储存动物的各种叫声，访问类型为private，比如
    //List sounds = new ArrayList();
    //sounds.push("瞄");
    //sounds.push("敖");
    //成员属性3，动物的食物，foods，类型为List，foods用来存储该动物爱吃的各种食物对象Food，访问类型为private，比如
    //List foods = new ArrayList();
    //foods.add(new Food("鱼", 10));
    //foods.add(new Food("米饭", 3));
    private String name;
    private List sounds;
    private List foods;
//构造方法，自行设计
    public Animal() {
    }

    public Animal(String name, List sounds, List foods) {
        this.name = name;
        this.sounds = sounds;
        this.foods = foods;
    }
    //成员方法1，void eat()，方法体里输出打印“能吃就能睡”
    public void eat(){
        System.out.println("能吃就能睡");
    }
//成员方法其他，name、sound、food对应的getter和setter
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List getSounds() {
        return sounds;
    }

    public void setSounds(List sounds) {
        this.sounds = sounds;
    }

    public List getFoods() {
        return foods;
    }

    public void setFoods(List foods) {
        this.foods = foods;
    }

}
